<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/mobile/include/taglib.jsp"%>
<html>
<head>
	<title>商品订单</title>
	<%@include file="/WEB-INF/views/mobile/include/head.jsp" %>
	<style type="text/css">
	
	</style>
	<script type="text/javascript">
		var appId = '${appId}';
		var ctxFront = "${ctxFront}";
		var ctxShop = "${ctxShop}";
		$(document).ready(function() {
			$("#listForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		
		function toOrderList(url){
			loading('正在获取，请稍等...');
			setTimeout(function(){
				hideLoader();
				document.location=url+"&appId="+appId;				
			},1000);
		}
	</script>
	<script type="text/javascript"> 
		function iEventGetNavgitionInfo(){
			var result = {
				title:"商品订单",
			    leftBtn:{ 
			    	type:0,	//0只显示返回,1只显示关闭，2显示返回，关闭
					backFun:"iEventGoBack()"   //返回执行的事件，不带的话由iOS控制。
				}               
			};
			if($global_isAndroid){
				window.control.onJsComplete(JSON.stringify(result));
				return;
			}
			return JSON.stringify(result);
		}
		function iEventGoBack(){
			document.location="ievent://quitWebView";
		}
	</script>
</head>
<body data-role="page">
	<div role="main" class="ui-content" style="padding:0px 1em 3em 1em;">
		<div id="popup" data-role="popup" data-position-to="window" data-overlay-theme="a" data-theme="b" class="ui-content">
		  <p></p>
		</div>
		<form:form id="listForm" action="${ctxShop}/myorder" method="post" class="form-horizontal">
		<input type="hidden" id="mobile" name="mobile" value="${user.mobile }"/>
		<input type="hidden" id="username" name="username" value="${user.name }"/>
		<tags:mbmessage content="${message}"/>
		<!--我的订单 -->
		<ul data-role="listview" data-inset="true" data-divider-theme="a" class="order-ui-index">
			<li data-role="list-divider"><div class="title-icon"><img src="${ctxFront }/images/shop/icon_5.png" alt="我的订单"></div>我的订单</li>
			<li data-icon="false">
		    	<a href="javascript:" onclick="toOrderList('${ctxShop }/myorder/list?userId=${user.id}&type=1')">
		    		<div class="order-icon"><img src="${ctxFront }/images/shop/myorder/icon_1.png" alt="全部"></div>
		    		<label class="float-left">全部（${list[0] }）</label>
		    		<span class="float-right check_arrow"></span>
		    	</a>
		    </li>
		    <li data-icon="false">
		    	<a href="javascript:" onclick="toOrderList('${ctxShop }/myorder/list?userId=${user.id}&type=2')">
		    		<div class="order-icon"><img src="${ctxFront }/images/shop/myorder/icon_2.png" alt="代付款"></div>
		    		<label class="float-left">代付款（${list[1] }）</label>
		    		<span class="float-right check_arrow"></span>
		    	</a>
		    </li>
		    <li data-icon="false">
		    	<a href="javascript:" onclick="toOrderList('${ctxShop }/myorder/list?userId=${user.id}&type=3')">
		    		<div class="order-icon"><img src="${ctxFront }/images/shop/myorder/icon_3.png" alt="待发货"></div>
		    		<label class="float-left">待发货（${list[2] }）</label>
		    		<span class="float-right check_arrow"></span>
		    	</a>
		    </li>
		    <li data-icon="false">
		    	<a href="javascript:" onclick="toOrderList('${ctxShop }/myorder/list?userId=${user.id}&type=4')">
		    		<div class="order-icon"><img src="${ctxFront }/images/shop/myorder/icon_4.png" alt="待收货"></div>
		    		<label class="float-left">待收货（${list[3] }）</label>
		    		<span class="float-right check_arrow"></span>
		    	</a>
		    </li>
		    <li data-icon="false">
		    	<a href="javascript:" onclick="toOrderList('${ctxShop }/myorder/list?userId=${user.id}&type=5')">
		    		<div class="order-icon"><img src="${ctxFront }/images/shop/myorder/icon_5.png" alt="已完成"></div>
		    		<label class="float-left">已完成（${list[4] }）</label>
		    		<span class="float-right check_arrow"></span>
		    	</a>
		    </li>
		    <li data-icon="false">
		    	<a href="javascript:" onclick="toOrderList('${ctxShop }/myorder/list?userId=${user.id}&type=6')">
		    		<div class="order-icon"><img src="${ctxFront }/images/shop/myorder/icon_6.png" alt="已取消"></div>
		    		<label class="float-left">已取消（${list[5] }）</label>
		    		<span class="float-right check_arrow"></span>
		    	</a>
		    </li>
		</ul>
		</form:form>
	</div>
</body>
</html>
